package itanty.aop3;

import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;

/**
 * @date 2025/9/23
 */
public class ExceptionAdvice implements ThrowsAdvice {
    /**
     * 异常通知
     * @param method
     * @param args
     * @param target
     * @param e      执行过程中遇到的异常
     */
    public void afterThrowing(Method method, Object[] args, Object target, Exception e) {
        System.out.println(target + "目标类中的" + method.getName() + "方法执行遇到了异常,异常为:" + e);
    }
}
